package com.example.train.infra.repository.impl;

import com.example.train.domain.entity.Department;
import com.example.train.domain.repository.DepartmentRepository;
import com.example.train.infra.mapper.DepartmentMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: ActingK20 42643
 * @Date: 2023/3/24 14:41
 */
@Component
public class DepartmentRepositoryImpl implements DepartmentRepository {
    private final DepartmentMapper departmentMapper;
    public DepartmentRepositoryImpl(DepartmentMapper departmentMapper){
        this.departmentMapper = departmentMapper;
    }
    @Override
    public List<Department> findDepartmentByCondition(Long id) {
        return departmentMapper.findDepartmentByCondition(id);
    }

    @Override
    public Integer insertDepartmentByCondition(Department department) {
        return departmentMapper.insertDepartmentByCondition(department);
    }

    @Override
    public Integer delDepartmentByCondition(Long id) {
        return departmentMapper.delDepartmentByCondition(id);
    }

    @Override
    public Integer updateDepartmentByCondition(Department department) {
        return departmentMapper.updateDepartmentByCondition(department);
    }
}
